package cn.com.main;

import cn.com.utils.HttpClientUtil;
import okhttp3.Headers;
import okhttp3.Request;
import okhttp3.Response;

import java.util.HashMap;
import java.util.Map;

public class HttpsDemo {

    public static void main(String[] args) {
        try {
            // 设置请求 URL
            String apiUrl = "https://mgt.pfkf-bss.com/api/v1/oss/access/key?pagenum=0&pagesize=10";
            Request.Builder builder = new Request.Builder();
            builder.url(apiUrl);
            Map<String, String> objectObjectHashMap = new HashMap<>();
            objectObjectHashMap.put("Secret-Access-Key", "OD8Fe47qWUdDgOdjkk0i");
            objectObjectHashMap.put("Access-Key", "aOUeqIzSKITxmL6Ygl7nwJYfd5sjmSOKB9BHt2QF");
            builder.headers(Headers.of(objectObjectHashMap));
            builder.get();
            Request request = builder.build();
            Response response = HttpClientUtil.getUnsafeOkHttpClient().newCall(request).execute();
            // 解析响应内容
            HttpClientUtil.getResultResponse(response);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}
